home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #4 / Amiga Plus CD - 2000 - No. 4.iso / Tools / Grafik / Misc / ImageEnginer / ARexx / Sparkle.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-02-05  |  1.4 KB  |  62 lines

  1. /* Image Engineer ARexx macro script */
  2. /* by Simon Edwards                  */
  3. /* 12/6/95                           */
  4.  
  5. Options results
  6. signal on error         /* Setup a place for errors to go */
  7.  
  8. if arg()==0 then exit
  9.  
  10. 'GET_NUMBER "Threshold value to use" 1 255 "Ok|Cancel" 252 SLIDER'
  11. thresholdvalue=RESULT
  12.  
  13. HIGHPASS arg(1) 3 3 SCALE
  14. highfreq=RESULT
  15.  
  16. 'HISTOGRAM_EQUALIZATION' highfreq
  17. histoproject=RESULT
  18.  
  19. 'CLOSE' highfreq
  20.  
  21. THRESHOLD histoproject thresholdvalue
  22. thresproject=RESULT
  23.  
  24. CLOSE histoproject
  25.  
  26. 'CONVOLVE' thresproject '"IE:Convolves/Spark"'
  27. sparkproject=RESULT
  28.  
  29. CLOSE thresproject
  30.  
  31. THRESHOLD sparkproject 1
  32. primaryproject=RESULT
  33.  
  34. MARK primaryproject PRIMARY
  35. MARK arg(1) SECONDARY
  36. MARK sparkproject ALPHA
  37. COMPOSITE 0 0 ALPHA
  38.  
  39. CLOSE sparkproject
  40. CLOSE primaryproject
  41.  
  42. exit
  43.  
  44. /*******************************************************************/
  45. /* This is where control goes when an error code is returned by IE */
  46. /* It puts up a message saying what happened and on which line     */
  47. /*******************************************************************/
  48. error:
  49. if RC=5 then do           /* Did the user just cancel us? */
  50.     IE_TO_FRONT
  51.     LAST_ERROR
  52.     'REQUEST "'||RESULT||'"'
  53.     exit
  54. end
  55. else do
  56.     IE_TO_FRONT
  57.     LAST_ERROR
  58.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  59.     exit
  60. end
  61.  
  62.